-
Notifications
You must be signed in to change notification settings - Fork 329
Initial implementation for chat template parameters #904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good - will also need to be added to the logger, most likely GeneralConfigLogger
matches = pattern.findall(args) | ||
for key, value in matches: | ||
key = key.strip() | ||
if key == "generation_parameters": | ||
gen_params = re.sub(r"(\w+):", r'"\1":', value) | ||
generation_parameters_dict = json.loads(gen_params) | ||
if key == "chat_template_parameters": | ||
# Chat template parameters have strings as values that also need to be quoted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be relevant to have tests for parsing edge cases
ad43991
to
20461a6
Compare
helpful for #855 |
@@ -87,6 +87,7 @@ class GeneralConfigLogger: | |||
model_size: str = None | |||
|
|||
generation_parameters: dict | None = None | |||
chat_template_parameters: dict | None = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enables passing chat template parameters as follows:
It can probably be simplified and needs tests.